(Qfile_name_handler_alist): Extern it.
authorKenichi Handa <handa@m17n.org>
Mon, 9 Mar 2009 01:09:23 +0000 (01:09 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 9 Mar 2009 01:09:23 +0000 (01:09 +0000)
(load_charset_map_from_file): Temporarily bind
`file-name-handler-alist' to nil while calling openp.

src/charset.c

index 052f31868316035a9e2d571379f402c4c15f314d..1cbfa2fd497480a464827a5df9ed1f7bcc522abf 100644 (file)
@@ -477,6 +477,7 @@ read_hex (fp, eof)
   return n;
 }
 
+extern Lisp_Object Qfile_name_handler_alist;
 
 /* Return a mapping vector for CHARSET loaded from MAPFILE.
    Each line of MAPFILE has this form
@@ -490,7 +491,10 @@ read_hex (fp, eof)
    The returned vector has this form:
        [ CODE1 CHAR1 CODE2 CHAR2 .... ]
    where CODE1 is a code-point or a cons of code-points specifying a
-   range.  */
+   range.
+
+   Note that this funciton uses `openp' to open MAPFILE but ignores
+   `file-name-handler-alist to avoid running any Lisp codes.  */
 
 extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
 
@@ -508,11 +512,14 @@ load_charset_map_from_file (charset, mapfile, control_flag)
   Lisp_Object suffixes;
   struct charset_map_entries *head, *entries;
   int n_entries;
+  int count = SPECPDL_INDEX ();
 
   suffixes = Fcons (build_string (".map"),
                    Fcons (build_string (".TXT"), Qnil));
 
+  specbind (Qfile_name_handler_alist, Qnil);
   fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil);
+  unbind_to (count, Qnil);
   if (fd < 0
       || ! (fp = fdopen (fd, "r")))
     {